home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / fontutil.6 / fontutil / fontutils-0.6 / include / c-memstr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-17  |  1.6 KB  |  58 lines

  1. /* c-memstr.h: memcpy, strchr, etc.
  2.  
  3. Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef C_MEMSTR_H
  20. #define C_MEMSTR_H
  21.  
  22. #include "c-std.h"
  23.  
  24. /* Just to be complete, we make both the system V/ANSI and the BSD
  25.    versions of the string functions available.  */
  26. #if USG || STDC_HEADERS
  27. #include <string.h>
  28. #define index strchr
  29. #define rindex strrchr
  30. #ifndef bcmp
  31. #define bcmp(s1, s2, len) memcmp ((s1), (s2), (len))
  32. #endif
  33. #ifndef bcopy
  34. #define bcopy(from, to, len) memcpy ((to), (from), (len))
  35. #endif
  36. #ifndef bzero
  37. #define bzero(s, len) memset ((s), 0, (len))
  38. #endif
  39. #else
  40. #include <strings.h>
  41. #define strchr index
  42. #define strrchr rindex
  43. #ifndef NEED_MEMORY_H
  44. #define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
  45. #define memcpy(to, from, len) bcopy ((from), (to), (len))
  46. #endif
  47. extern char *strtok ();
  48. extern char *strstr ();
  49. #endif /* not USG or STDC_HEADERS */
  50.  
  51. /* SunOS 4.1 declares memchr in <memory.h>, not <string.h>.  I don't
  52.    understand why.  */
  53. #if NEED_MEMORY_H
  54. #include <memory.h>
  55. #endif
  56.  
  57. #endif /* not C_MEMSTR_H */
  58.